﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model.Interfaces;

namespace Model
{
    public class Equation : IEquation
    {
        private readonly Func<double, double, double> _equation; 

        public double A { get; set; }
        public double M { get; set; }
        
        public Equation()
        {
            
        }

        public Equation(double a, double m)
        {
            A = a;
            M = m;
            _equation = (x, y) => (A*(1 - Math.Pow(y, 2)))/((1 + M)*Math.Pow(x, 2) + Math.Pow(y, 2) + 1);
        }

        public double Calculate(double x, double y)
        {
            return _equation(x, y);
        }
    }
}
